//
//  ICMTimeBarView.m
//  ICrEAM
//
//  Created by rainimute on 16/11/3.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "ICMTimeBarView.h"

@implementation ICMTimeBarView
#pragma mark    初始化
- (instancetype)initWithFrame:(CGRect)frame andItemWidth:(float)itemWidth{
    if (self = [super initWithFrame:frame]) {
        NSArray *timeStrings = @[@"7:00",@"7:30",@"8:00",@"8:30",@"9:00",@"9:30",@"10:00",@"10:30",@"11:00",@"11:30",@"12:00",@"12:30",@"13:00",@"13:30",@"14:00",@"14:30",@"15:00",@"15:30",@"16:00",@"16:30",@"17:00",@"17:30",@"18:00",@"18:30",@"19:00",@"19:30",@"20:00"];
        for (NSInteger i=0; i<timeStrings.count; i++) {
            UILabel *timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(i*2*itemWidth, 0, 2*itemWidth, CGRectGetHeight(frame))];
            [timeLabel setUpLabelWithText:timeStrings[i] alignment:NSTextAlignmentCenter textSize:13 textColor:[UIColor grayColor]];
            [self addSubview:timeLabel];
        }
    }
    return self;
}

+ (instancetype)createTimeBarViewWithFrame:(CGRect)frame andItemWidth:(float)itemWidth{
    return [[ICMTimeBarView alloc]initWithFrame:frame andItemWidth:itemWidth];
}
@end
